<?php
class Access{
	public function __construct(){
		if (!$this->accessFile()){
			$this->setRedirect("index.php");
		}
	}	
	public function accessFile(){
		$session = new sessions();
		$user = $session->getSession();
//		print_r($user);exit;
		if ($user['user_id'] > 0 && $user['user_id'] != ""){
			return true;
		}else{
			return false;
		}
	}
	
	public function setRedirect($url = ''){
		header("Location: ".$url);exit;
	}
}
?>